namespace ContosoUniversity.DAL
{
    using System;
    using System.Linq.Expressions;
    using Models;
    using NRepository.Core.Query.Specification;

    public class FindDepartmentByIdSpecificationStrategy : SpecificationQueryStrategy<Department>
    {
        public FindDepartmentByIdSpecificationStrategy(int? departmentId)
        {
            DepartmentId = departmentId.Value;
        }

        public FindDepartmentByIdSpecificationStrategy(int departmentId)
        {
            DepartmentId = departmentId;
        }

        public int DepartmentId
        {
            get;

        }

        public override Expression<Func<Department, bool>> SatisfiedBy(object additionalQueryData)
        {
            return p => p.DepartmentID == DepartmentId;
        }
    }
}